<!--
    Author : Gisca
    Halaman untuk mengedit data diri pribadi
-->
<link rel="stylesheet" type="text/css" href="<?php echo base_url(); ?>assets/style/template/css/general.css" />
<script type="text/javascript" src="<?php echo base_url(); ?>assets/style/template/js/generalUI.js"></script>
<?php if (isset($pesan))echo $pesan;?>
<head>
	<title>Edit Data Diri</title>
</head>


<form method="post" name="formEditPengguna" action="<?php echo site_url('ServerMengubahDataDiriPribadi/simpanEditPengguna')?>">
<input type='hidden' name='user_id' value='<?php echo $user_id?>'/>

<fieldset id="editDataPengguna">
    <legend>&nbsp; Edit Data Diri</legend>
    <table>
        <tr>
            <td valign="top">
                <label for="username">User ID</label>
            </td>
            <td>
                <!--<input type="text" name="username" id="usernameEdit" value="<?php echo $usernameEdit; ?>" onkeyup="validasiUsername(document.getElementById('usernameEdit').value)"/>-->
                <?php echo $usernameEdit; ?>
            </td>
            <td>
                <label id="validasiusername" class="validasi"></label>
                <input id="validasiusr" type="hidden" value=""/>
            </td>
        </tr>

        <tr>
            <td>
                <label for="name">Nama Lengkap</label>
            </td>
            <td>
                <input type="text" name="name" id="nameEdit" value="<?php echo $nameEdit; ?>" onkeyup="validasiNama(document.getElementById('nameEdit').value)"/>
            </td>
            <td>
                <label id="validasinama" class="validasi"></label>
                <input id="validasinm" type="hidden" value=""/>
            </td>
        </tr>

         <tr>
            <td>
                <label for="password">Password</label>
            </td>
            <td>
                <input type="password" name="password" id="passwordEdit" value="<?php echo $passwordEdit; ?>" onkeyup="validasiPassword(document.getElementById('passwordEdit').value)"/>
            </td>
            <td>
                <label id="validasipassword" class="validasi"></label>
                <input id="validasipass" type="hidden" value=""/>
            </td>
        </tr>

        <tr>
            <td>
                <label for="password">Konfirmasi Password</label>
            </td>
            <td>
                <input type="password" name="password" id="passwordkonfirmasiEdit" value="<?php echo $passwordEdit; ?>" onkeyup="validasiPasswordLagi(document.getElementById('passwordEdit').value, document.getElementById('passwordkonfirmasiEdit').value)"/>
            </td>
            <td>
                <label id="validasipasswordlagi" class="validasi"></label>
                <input id="validasipasslagi" type="hidden" value=""/>
            </td>
        </tr>

        <tr>
            <td>
                <label for="email">Email</label>
            </td>
            <td>
                <input type="text" name="email" id="emailEdit" value="<?php echo $emailEdit; ?>" onkeyup="validasiEmail(document.getElementById('emailEdit').value)"/>
            </td>
            <td>
                <label id="validasiemail" class="validasi"></label>
                <input id="validasimail" type="hidden" value=""/>
            </td>
        </tr>

        <tr>
            <td valign="top">
                <label for="gender">Jenis Kelamin</label>
            </td>
            <td>
                <?php
                    if($genderEdit == "L")
                        {
                            echo form_radio('gender', 'L', true), ('Laki-Laki');
                            echo ("<br>");
                            echo form_radio('gender', 'P', false),("Perempuan");
                        }
                    else if($genderEdit == "P")
                        {                            
                            echo form_radio('gender', 'L', false),("Laki-Laki\n");
                            echo ("<br>");
                            echo form_radio('gender', 'P', true), ("Perempuan");
                        }
                ?>
            </td>
        </tr>

        <tr>
            <td valign="top">
                <label for="address">Alamat</label>
            </td>
            <td>
                <?php
                    echo ("<textarea rows=\"3\" cols=\"16\" id=\"address\" name=\"address\" onkeyup=\"validasiAlamat(document.getElementById('address').value);\">$addressEdit</textarea>");
                ?>
           </td>
           <td>
                <label id="validasialamat" class="validasi"></label>
                <input id="validasiaddr" type="hidden" value=""/>
           </td>
        </tr>

        <tr>
            <td>
                <label for="telp">Telepon</label>
            </td>
            <td>
                <input type="text" name="telp" id="telpEdit" value="<?php echo $telpEdit; ?>" onkeyup="validasiNoTelp(document.getElementById('telpEdit').value)" />
            </td>
            <td>
                <label id="validasinotelp" class="validasi"></label>
                <input id="validasitelp" type="hidden" value=""/>
            </td>
        </tr>
    </table>
    <a href="http://localhost/amelia/index.php"><strong>Back</strong></a>
        <!--<button type="button" id="Cancel" onclick="<?php echo site_url('ServerMengubahDataDiriPribadi/redirectHome')?>">Cancel</button>&nbsp;&nbsp;-->
        <button type="button"  class="f-submit" id="simpan" onclick="crosscheck();">Simpan</button>
<!--
    <input type="submit" value="Simpan" onclick="crosscheck();"/>
-->
</fieldset>
</form>
